﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:SharpMap.Presentation.Wpf"
    xmlns:prim="clr-namespace:SharpMap.Presentation.Wpf.Controls.Primitives"
    xmlns:ctrls="clr-namespace:SharpMap.Presentation.Wpf.Controls"                    >
    <Style TargetType="{x:Type local:MapView}">
     <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type local:MapView}">
          <Border 
                BorderThickness="{TemplateBinding Border.BorderThickness}" 
                BorderBrush="{TemplateBinding Border.BorderBrush}" 
                Background="{TemplateBinding Panel.Background}" 
                Name="Bd" SnapsToDevicePixels="True">
            <Canvas x:Name="_canvas"
                ClipToBounds="True" >
                
                    <local:DrawingLayer 
                        x:Name="PART_DrawingLayer"  
                        Width="{Binding ElementName=_canvas, Path=ActualWidth}"
                        Height="{Binding ElementName=_canvas, Path=ActualHeight}" />
                    
                    <local:DrawingLayer 
                        x:Name="PART_MapAdornersLayer" 
                        RenderedObjectsSourcePath="RenderedAdorners" 
                        Width="{Binding ElementName=_canvas, Path=ActualWidth}"
                        Height="{Binding ElementName=_canvas, Path=ActualHeight}" />
              
            </Canvas>
           </Border>
        </ControlTemplate>
      </Setter.Value>
     </Setter>
    </Style>
</ResourceDictionary>